package com.five.api;

import com.five.pojo.Novel;
import com.five.pojo.Reader;
import com.five.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(name="reader-service", contextId = "readerServiceAPI")
public interface ReaderApi {
    @PostMapping("reader/queryByPhone/{phone}")
    public Result<Reader> queryByPhone(@PathVariable String phone);

    @PostMapping("reader/queryByEmail/{email}")
    public Result<Reader> queryByEmail(@PathVariable String email);

    @PostMapping("reader/queryByLoginInfoId/{loginInfoId}")
    public Result<Reader> queryByLoginInfoId(@PathVariable Long loginInfoId);

    @PostMapping("reader/insertReader")
    public Result insertReader(@RequestBody Reader reader);

    @PostMapping("reader/updateReader")
    public Result updateReader(@RequestBody Reader reader);

    /**
     *根据账号查询读者信息
     * @param
     * @return
     */
    @PostMapping("reader/queryByAccount/{account}")
    public Result<Reader> queryByAccount(@PathVariable String account);
    /**
     * 单数据同步小说数据
     */
    @PostMapping("reader/search/sync/single")
    public Result<String> syncSingleNovel(@RequestBody Novel novel);

}


